class CQueue {
    Deque<Integer> st1 = new LinkedList<>();
        Deque<Integer> st2 = new LinkedList<>();

        public CQueue() {

        }

        public void appendTail(int value) {
            st2.push(value);
        }

        public int deleteHead() {
            if(st1.isEmpty() && st2.isEmpty())
                return -1;
            // 将st2的全部元素移到st1当中去
            if(st1.isEmpty()){
                while (!st2.isEmpty()){
                    st1.push(st2.pop());
                }
            }
            return st1.pop();
        }
}
